# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  # Be sure to include AuthenticationSystem in Application Controller instead
  include AuthenticatedSystem

  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_favourails_session_id'

  # If you want "remember me" functionality, add this before_filter to Application Controller
  before_filter :login_from_cookie, :resolve_time_zone

  private
  def resolve_time_zone
    @time_zone = TimeZone[params[:time_zone] || 'Beijing'] || TimeZone['Beijing']
  end
end
